Application deployment using reduced overhead bytecode

ABSTRACT

A system includes a memory, a processor in communication with the memory, and a recorder. The recorder is configured to obtain a proxy for each respective real object. Each respective real object is related to a respective service. The recorder is also configured to record a sequence of each invocation on each respective proxy and generate an intermediate representation of an application that is configured to invoke the sequence of each invocation on each real object associated with each respective proxy.

CROSS REFERENCES TO RELATED APPLICATIONS

This application is a continuation of and claims priority to and thebenefit of U.S. patent application Ser. No. 16/224,264, filed on Dec.18, 2018, the entire content of which is hereby incorporated byreference.

BACKGROUND

Computer systems may run applications or services that are provided viaa server or cloud. The applications or services can be developed anddeployed at runtime. Application instances or services may run withincontainers, which may be run on physical or virtual machines. Forexample, containers may encapsulate a runtime environment for anapplication instance or service. Application instances may be started orreplicated across nodes and each application instance may requireclasses, artifacts, dependencies, annotations, libraries, etc. to beloaded at various times (e.g., configuration, runtime or deployment).

SUMMARY

The present disclosure provides new and innovative systems and methodsfor application deployment using reduced overhead bytecode. In anexample, a system includes a memory, a processor in communication withthe memory, and a recorder. The recorder is configured to obtain a proxyfor each respective real object. Each respective real object is relatedto a respective service. The recorder is also configured to record asequence of each invocation on each respective proxy and generate anintermediate representation of an application that is configured toinvoke the sequence of each invocation on each real object associatedwith each respective proxy.

In an example, a method includes creating a recorder and obtaining aproxy for each respective real object. Each respective real object isrelated to a respective service. The method also includes recording asequence of each invocation on each respective proxy and generating anintermediate representation of an application from the sequence.

In an example, a method includes creating a recorder object andrecording a sequence of invocations on a plurality of proxies. Eachproxy of the plurality of proxies is associated with a respective realobject. The method also includes generating bytecode from the recordedsequence of invocations and executing the bytecode to start runtimeservices of an application by invoking the sequence of invocations onthe real objects associated with the plurality of proxies.

Additional features and advantages of the disclosed method and apparatusare described in, and will be apparent from, the following DetailedDescription and the Figures. The features and advantages describedherein are not all-inclusive and, in particular, many additionalfeatures and advantages will be apparent to one of ordinary skill in theart in view of the figures and description. Moreover, it should be notedthat the language used in the specification has been principallyselected for readability and instructional purposes, and not to limitthe scope of the inventive subject matter.

BRIEF DESCRIPTION OF THE FIGURES

FIG. 1 illustrates a block diagram of an example computing systemaccording to an example embodiment of the present disclosure.

FIG. 2 illustrates a flowchart of an example process for generatingbytecode for application deployment at build time according to anexample embodiment of the present disclosure.

FIG. 3 illustrates a flowchart of an example process for generating anintermediate representation for application deployment according to anexample embodiment of the present disclosure.

FIG. 4 illustrates a flowchart of an example process for applicationdeployment using reduced overhead bytecode according to an exampleembodiment of the present disclosure.

FIGS. 5A and 5B illustrate a flow diagram of an example process forapplication deployment using reduced overhead bytecode according to anexample embodiment of the present disclosure.

FIG. 6 illustrates a block diagram of an example bytecode generationsystem according to an example embodiment of the present disclosure.

DETAILED DESCRIPTION OF EXAMPLE EMBODIMENTS

Generating intermediate representations, such as custom Java bytecode,at runtime is a complex process that involves writing out the bytecodedirectly using a bytecode generation library. Typically, writing out thebytecode directly using a bytecode generation library requires extensiveknowledge of Java Virtual Machine (“JVM”) internals. The complexity ofgenerating bytecode typically makes such implementations difficult tointegrate. For example, a security provider interface (“SPI”) mayrequire users to generate bytecode directly and thus may be toodifficult for an average developer to easily work with. Developers andprogrammers use engine classes to perform desired operations and eachengine class may have a public interface that defines the operations theengine can perform. However, the engine classes may employ third-partysecurity providers. For example, the engine classes have an additionalinterface called the SPI. The SPI is a set of methods that a particularengine must implement in order provide a particular operation.

To automate and simplify the intermediate representation (e.g.,bytecode) generation process, techniques are disclosed for applicationdeployment using reduced overhead intermediate representations includinggenerating an intermediate representation (e.g., bytecode) using proxybased action recorders. Proxy based action recorders allow users (e.g.,developers and programmers) to call methods on proxy objects (e.g.,proxies associated with real objects) such that invocations are recordedand written out into an intermediate representation (e.g., bytecode).The intermediate representation (e.g., bytecode) generated by therecorder performs the same sequence of invocations on the real objects.Additionally, the intermediate representations may be generated at buildtime to reduce application startup time and runtime memory usage.Generating intermediate representation(s) (e.g., bytecode) prior toruntime (e.g., at build time) improves efficiency by allowing runtimeservices to start sooner and with a smaller runtime memory footprint.Specifically, by pre-generating the intermediate representation (e.g.,bytecode) using a recorder, rather than directly writing out theintermediate representation (e.g., bytecode), the intermediaterepresentation may be implemented by less experiences users. Bydeploying applications using the intermediate representation (bytecode),fewer resources are consumed when starting nodes and applicationinstances by executing the intermediate representation.

As described in the various example embodiments disclosed herein, toautomatically generate intermediate representations (e.g., Javabytecode) without extensive knowledge of writing out Java bytecodedirectly and to eliminate the need to generate intermediaterepresentations (e.g., custom Java Virtual Machine (“JVM”) bytecode) atruntime, the system and methods disclosed herein advantageously recordinvocations and automatically write out the intermediate representationsthat perform the same sequence of invocations. The intermediaterepresentations (e.g., custom JVM bytecode) may be generated at buildtime, which can be directly executed at runtime to conserve systemresources. For example, the systems and methods disclosed herein maycreate a recorder, obtain a proxy for each respective real object thatthe user plans to invoke on, record a sequence of each invocation oneach respective proxy, and generate an intermediate representation(e.g., Java bytecode) of an application from the sequence.

By allowing a user to call methods on a proxy, and recording theinvocations such that the recorder can write out or generate associatedbytecode, developers or programmers may generate bytecode without havingextensive knowledge of JVM internals or bytecode generation libraries.By calling methods and invocations (including method parameters) on theproxies up front at build time, fewer resources are used when startingnodes in a cloud environment. The present disclosure is especiallyadvantageous to cloud providers that want to optimize the efficiency ofthe cloud by reducing startup times and reducing memory usage. Forexample, cloud providers like the Red Hat® Cloud Suite may utilizebytecode for application instances to reduce overhead. By pre-generatingthe bytecode and later executing the bytecode at runtime, the systemsand methods disclosed herein consume less runtime memory because theresulting deployed application is smaller (i.e., contains less classes)than applications that are typically built at runtime.

FIG. 1 depicts a high-level component diagram of an example computingsystem 100 in accordance with one or more aspects of the presentdisclosure. The computing system 100 may include a recorder 160, proxyobjects 162A-C (also referred to herein as a proxy or proxies), one ormore virtual machines (VM 170A-B), and nodes (e.g., nodes 110A-C).

Recorder 160 may be a recorder object and may record invocations of theproxy objects 162A-C. For example, a user (e.g., developer orprogrammer) may obtain proxy objects 162A-C for associated real objects.The user may invoke the proxy objects 162A-C by calling methods on theproxy objects 162A-C. These invocations are recorded by the recorder 160in the sequence in which they are invoked. The recorder 160 may alsogenerate an intermediate representation (e.g., Java bytecode) from therecorded sequence of invocations. For example, when the user closes therecorder 160, the recorder 160 may generate bytecode. The recorder 160may be a program running on a processor (e.g., CPU 120A-E or VCPU190A-B). For example, VCPU 190A and VCPU 190B may each have their owntranslator that runs on the processor.

The bytecode may be executed to start runtime services for variousapplications (e.g., Applications 198A-D). For example, the bytecode maybootstrap runtime services by directly calling runtime classes when thebytecode is executed. Additionally, the bytecode may be translated intomachine code for the virtual machines 170A-B at runtime. In an example,applications 198A-D may be different applications or services. Inanother example, applications 198A-D may be different instances of thesame application or service.

Virtual machines 170A-B may include a virtual machine memory (VMMemory), a virtual CPU (VCPU), virtual memory devices (VMD), and virtualinput/output devices (VI/O). For example, virtual machine 170A mayinclude virtual machine memory 195A, a virtual CPU 190A, a virtualmemory devices 192A, and a virtual input/output device 194A. Similarly,virtual machine 170B may include virtual machine memory 195B, a virtualCPU 190B, a virtual memory devices 192B, and virtual input/output device194B.

In an example, a virtual machine 170A may execute a guest operatingsystem and run applications 198A-B which may utilize the underlying VCPU190A, VMD 192A, and VI/O device 194A. One or more applications 198A-Bmay be running on a virtual machine 170A under the respective guestoperating system. A virtual machine (e.g., VM 170A-B, as illustrated inFIG. 1) may run on any type of dependent, independent, compatible,and/or incompatible applications on the underlying hardware andoperating system (“OS”). In an example, applications (e.g., App 198A-B)run on a virtual machine 170A may be dependent on the underlyinghardware and/or OS. In another example embodiment, applications 198A-Brun on a virtual machine 170A may be independent of the underlyinghardware and/or OS. For example, applications 198A-B run on a firstvirtual machine 170A may be dependent on the underlying hardware and/orOS while applications (e.g., application 198C-D) run on a second virtualmachine (e.g., VM 170B) are independent of the underlying hardwareand/or OS. Additionally, applications 198A-B run on a virtual machine170A may be compatible with the underlying hardware and/or OS 186. In anexample embodiment, applications 198A-B run on a virtual machine 170Amay be incompatible with the underlying hardware and/or OS 186. Forexample, applications 198A-B run on one virtual machine 170A may becompatible with the underlying hardware and/or OS 186 while applications198C-D run on another virtual machine 170B are incompatible with theunderlying hardware and/or OS 186.

In an example, virtual machines 170A-B may instead be containers thatexecute applications or services, such as microservices. In an example,the containers may each run a process or service and the containers maybe executed in any execution environment. For example, the containersmay operate as a virtual server. It should be appreciated thatcontainers may be stand-alone execution environments, similar to that ofa virtual machine. The applications 198A-D or services (e.g.,microservices) may run in a software container or a virtual machine(e.g., virtual machines 170A-B).

The computer system 100 may include one or more nodes 110A-C. Each node110A-C may in turn include one or more physical processors (e.g., CPU120A-E) communicatively coupled to memory devices (e.g., MD 130A-D) andinput/output devices (e.g., I/O 140A-C). Each node 110A-C may be acomputer, such as a physical machine and may include a device, such ashardware device. In an example, a hardware device may include a networkdevice (e.g., a network adapter or any other component that connects acomputer to a computer network), a peripheral component interconnect(PCI) device, storage devices, disk drives, sound or video adaptors,photo/video cameras, printer devices, keyboards, displays, etc. Virtualmachines 170A-B may be provisioned on the same host or node (e.g., node110A) or different nodes. For example, VM 170A and VM 170B may both beprovisioned on node 110A. Alternatively, VM 170A may be provided on node110A while VM 170B is provisioned on node 110B.

As used herein, physical processor or processor 120A-E refers to adevice capable of executing instructions encoding arithmetic, logical,and/or I/O operations. In one illustrative example, a processor mayfollow Von Neumann architectural model and may include an arithmeticlogic unit (ALU), a control unit, and a plurality of registers. In afurther aspect, a processor may be a single core processor which istypically capable of executing one instruction at a time (or process asingle pipeline of instructions), or a multi-core processor which maysimultaneously execute multiple instructions. In another aspect, aprocessor may be implemented as a single integrated circuit, two or moreintegrated circuits, or may be a component of a multi-chip module (e.g.,in which individual microprocessor dies are included in a singleintegrated circuit package and hence share a single socket). A processormay also be referred to as a central processing unit (CPU).

As discussed herein, a memory device 130A-D refers to a volatile ornon-volatile memory device, such as RAM, ROM, EEPROM, or any otherdevice capable of storing data. As discussed herein, I/O device 140A-Crefers to a device capable of providing an interface between one or moreprocessor pins and an external device capable of inputting and/oroutputting binary data.

Processors (e.g., CPUs 120A-E) may be interconnected using a variety oftechniques, ranging from a point-to-point processor interconnect, to asystem area network, such as an Ethernet-based network. Localconnections within each node, including the connections between aprocessor 120A-E and a memory device 130A-D may be provided by one ormore local buses of suitable architecture, for example, peripheralcomponent interconnect (PCI).

FIG. 2 illustrates a flowchart of an example method 200 for generatingbytecode for application deployment. Although the example method 200 isdescribed with reference to the flowchart illustrated in FIG. 2, it willbe appreciated that many other methods of performing the acts associatedwith the method 200 may be used. For example, the order of some of theblocks may be changed, certain blocks may be combined with other blocks,blocks may be repeated, and some of the blocks described are optional.The method 200 may be performed by processing logic that may comprisehardware (circuitry, dedicated logic, etc.), software, or a combinationof both.

The example method 200 includes starting an application build (block210) prior to runtime 202 (e.g., at build time 201). Then, method 200includes creating a recorder 160 (block 220) and obtaining proxyobject(s) for relevant service(s) (block 230). Proxy objects 162A-B maybe obtained for a service, such as a “web service setup” service or a“start web server” service. The user (e.g., developer or programmer) mayinvoke on the proxy object(s) (block 240) prior to runtime 202. Forexample, the user may call a sequence of methods on the proxy object(s)162A-C. In an illustrative example, the user may call methods on the“web service setup” service and the “start web server” service or objectto add web endpoints and then start a server. The invocation may alsoinclude method parameters, for example, the “start web server” object orservice may include a parameter for the integer port that identifieswhich port the web server listens to. In an example, the parameter mayindicate or define port_80. The recorder 160 may record the sequence ofinvocations and generate invocation bytecode (block 250). For example,the bytecode is generated to invoke a similar series or sequence ofinvocations on the real object(s) associated with the proxy object(s).In an example, the recorder 160 may automatically generate the bytecodeafter the recorder is stopped or paused.

The bytecode may invoke on the real objects or services, such as “webservice setup” and “start web server.” As discussed above, the bytecodemay be executed to invoke on the real objects (e.g., call methods on thereal objects) in order to add web endpoints and start the server.

Then, at runtime 202, method 200 includes starting runtime services(block 260). For example, the bytecode may be executed to start runtimeservices and the executed bytecode may bootstrap the runtime services.When the application is started, the bytecode is run directly,advantageously allowing runtime services to be started efficientlywithout having to generate or write out the bytecode directly at runtime202. By pre-generating the bytecode using a recorder 160, extensiveknowledge of bytecode generation libraries or JVM internals is notnecessary thereby allowing more users (e.g., developers or programmers)to implement and integrate the bytecode. Additionally, the bytecodedescribed herein conserves system resources (e.g., runtime memory) andreduces startup times. The memory savings become more substantial whenstarting nodes or application instances in cloud environments. Forexample, using an additional MB of memory at build time may not appearsignificant for a single application, but in cloud environments withthousands of nodes running application instances (where each would usean additional MB of runtime memory), the runtime memory savings is morepronounced.

FIG. 3 illustrates a flowchart of an example method 300 for generatingan intermediate representation for application deployment. Although theexample method 300 is described with reference to the flowchartillustrated in FIG. 3, it will be appreciated that many other methods ofperforming the acts associated with the method 300 may be used. Forexample, the order of some of the blocks may be changed, certain blocksmay be combined with other blocks, blocks may be repeated, and some ofthe blocks described are optional. The method 300 may be performed byprocessing logic that may comprise hardware (circuitry, dedicated logic,etc.), software, or a combination of both.

The example method 300 includes creating a recorder (block 310). Forexample, a user may create a recorder 160. In an example, the recorder160 may be created prior to runtime (e.g., at build time). Then, method300 includes obtaining a proxy for each respective real object (block320). For example, a user may obtain a proxy object (e.g., proxy object162A-C) for each respective real object that the user intends to callmethods on or invoke on. In an example, each respective real object maybe related to a respective service. As discussed above, a service may bea “web service setup” service or object, which may be invoked to add webendpoints prior to starting a server. Additionally, method 300 includesrecording a sequence of each invocation on each respective proxy (block330). For example, the recorder 160 may record a sequence of eachinvocation (e.g., methods and the method parameters called) on eachrespective proxy object (e.g., proxy objects 162A-C). The sequence mayinclude the series of invocations on each proxy object (e.g., proxyobjects 162A-C) in the order the invocations are called by the user.Multiple invocations or calls may be performed on the same proxy object.For example, the sequence may include an invocation on proxy object162A, followed by three invocations on proxy object 162B, followed bytwo invocations on proxy object 162B, and finally another invocation ofproxy object 162A.

Some objects or service templates may include a single method.Conversely, other templates may include multiple methods such thatinvoking on the proxy object may include calling one of a plurality ofmethods. In some cases, the same proxy object may be invoked severaltimes during a recording session, either consecutively orintermittently.

Method 300 also includes generating an intermediate representation of anapplication from the sequence (block 340). For example, the recorder 160may generate the intermediate representation of an application (e.g.,application 198A-D) prior to runtime 202. The intermediaterepresentation may be automatically generated once the recorder 160 isdone recording (e.g., when the user pauses or stops the recorder). Theintermediate representation may be bytecode, such as JVM bytecode. Thebytecode (e.g., JVM bytecode) may also be referred to as portable codeor p-code. The bytecode is a form of instruction set designed forefficient execution by a software interpreter, and the bytecode is acompact numeric code that encode the result of invoking a similar seriesor sequence of invocations on the real objects associated with the proxyobjects 162A-C. It should be appreciated that other forms of bytecode ornative executable files may be generated. For example, common languageruntime (“CLR”) bytecode, common intermediate language (“CIL”) bytecodeor other executable codes may be generated all of which may be referredto as intermediate representations. By pre-generating the bytecode,application instances or runtime services may advantageously be startedefficiently without directly writing out or generating bytecode atruntime, which saves time and reduces the instant memory consumption ofthe application instance and reduces the memory footprint of theapplication during the applications life.

In an example, the proxy objects 162A-B may be discarded after thebytecode is generated. For example, proxy objects 162A-B may be createdor obtained each time a user generates bytecode from a recorder 160.

FIG. 4 illustrates a flowchart of an example method 400 for applicationdeployment using reduced overhead bytecode. Although the example method400 is described with reference to the flowchart illustrated in FIG. 4,it will be appreciated that many other methods of performing the actsassociated with the method 400 may be used. For example, the order ofsome of the blocks may be changed, certain blocks may be combined withother blocks, blocks may be repeated, and some of the blocks describedare optional. The method 400 may be performed by processing logic thatmay comprise hardware (circuitry, dedicated logic, etc.), software, or acombination of both.

The example method 400 includes creating a recorder object (block 410).For example, the user may create a recorder 160. In another example, therecorder 160 may be pre-created or may already exist in the currentsystem architecture. Then, method 400 includes recording a sequence ofinvocations on a plurality of proxies (block 420). For example, therecorder object (e.g., recorder 160) may record a sequence ofinvocations on a plurality of proxies (e.g., proxy objects 162A-C) thatare associated with respective real objects. The recorded invocations ormethods called on the plurality of proxies may also include the methodparameters associated with the called methods or invocations.Additionally, method 400 includes generating bytecode from the recordedsequence of invocations (block 430). For example, the recorder object(e.g., recorder 160) may generate bytecode from the recorded sequence ofinvocations. In an example, the generated bytecode may perform the samesequence or series of invocations on the real objects associated withthe plurality of proxies (e.g., proxy objects 162A-C). The bytecode maybe automatically generated by the recorder 160. For example, therecorder 160 my automatically generate the bytecode once the recorder ispaused or stopped, prior to the recorder 160 exiting or closing.

In an example, recorder 160 may be associated with a specific virtualmachine. For example, the recorder 160 may run on VM 170A, which maygenerate the bytecode. Then, method 400 includes executing the bytecodeto start runtime services of an application (block 440). For example,executing the bytecode may include invoking real objects and callingmethods. In an example, the bytecode may be executed after generation(e.g., after build time or at runtime). The virtual machine (e.g., VM170A-B) that executes the bytecode may be the same virtual machine(e.g., VM 170A) that generated the bytecode. In another example, thevirtual machine (e.g., VM 170B) that executes the bytecode may bedifferent from the virtual machine (e.g., VM 170A) that generated thebytecode. Similarly, the virtual machine that creates the recorderobject may be the same virtual machine or different virtual machine thatexecutes the recorder object (e.g., records sequence of invocations).Furthermore, the virtual machine that creates and/or executes therecorder object may be the same virtual machine or a different virtualmachine that generates and/or executes the bytecode. Additionally,different virtual machine instances or different virtual machines maygenerate and execute the bytecode. The different virtual machineinstances or different virtual machines may be on the same node (e.g.,computer or machine) or on different nodes (e.g., computers ormachines).

FIGS. 5A and 5B illustrates a flowchart of an example method 500 forapplication deployment using reduced overhead bytecode in accordancewith an example embodiment of the present disclosure. Although theexample method 500 is described with reference to the flowchartillustrated in FIGS. 5A and 5B it will be appreciated that many othermethods of performing the acts associated with the method 500 may beused. For example, the order of some of the blocks may be changed,certain blocks may be combined with other blocks, blocks may berepeated, and some of the blocks described are optional. For example, arecorder 160, proxy objects (e.g., Proxy_A and Proxy_B) and virtualmachine 170A may communicate to perform example method 500.

In the illustrated example, a real object (e.g., Object_A) includesmethods and classes (block 502). For example, Object_A may be a “webservice setup” object. A proxy object 162A (e.g., Proxy_A) may becreated and associated with Object_A (block 504). For example, Proxy_Amay include the same methods and classes as Object_A. Similarly, a realobject (e.g., Object_B) includes methods and classes (block 506). Forexample, Object_B may be a “start web service” object. A proxy object162B (e.g., Proxy_B) may be created and associated with Object_B (block508). For example, Proxy_B may include the same methods and classes asObject_B.

At build time (block 510), a user may invoke on Proxy_A (block 512). Forexample, the user may call methods on Proxy_A. In an illustrativeexample, the user may call methods on Proxy_A to add a web endpointprior to starting a server. Then, the recorder 160 records theinvocation on Proxy_A (block 514). After recording the invocation, theinvocation sequence includes the event of invoking Proxy_A (e.g.,denoted by “A”) resulting in a sequence of “A.” (block 516). Then, theuser may invoke on Proxy_B (block 518). For example, the user may callmethods on Proxy_B. In the illustrative example, the user may callmethods on Proxy_B to start the webserver. Then, the recorder 160records the invocation on Proxy_B (block 520). After recording theinvocation, the invocation sequence includes the event of invokingProxy_B (e.g., denoted by “B”) resulting in a sequence “A, B.” (block516). The user may again invoke on Proxy_A (block 524). For example, theuser may call methods on Proxy_A. In the illustrative example, the usermay call methods on Proxy_A to add another web endpoint after startingthe server. Then, the recorder 160 records the invocation on Proxy_A(block 526). After recording the invocation, the invocation sequenceincludes the event of invoking Proxy_A (e.g., denoted by “A”) resultingin a sequence “A, B, A.” (block 528).

In the illustrated example, the sequence includes the order and detailsof each invocation. For example, the sequence may identify whichspecific methods or what method parameters are involved with eachinvocation. Multiple methods or invocations may be recorded for the sameproxy object (e.g., Proxy_A or Proxy_B) in succession.

After the user has performed all the appropriate invocations (e.g.,called methods) on the proxy objects 162A-B (e.g., Proxy_A and Proxy_B),the user may pause or stop the recorder 160. Then, the recorder 160stops recording (block 530) and the recorder 160 generates bytecode(block 532). For example, the user may instruct the recorder 160 to exitor stop recording (e.g., pause the recorder). After the bytecode isgenerated, the recorder 160 may close. Automating and simplifying thebytecode generation process allows for implementing pre-generatedbytecode at build time instead of runtime for various systems and SPIs.Additionally, applications started by executing the bytecode may savetime and reduce the instant memory consumption of the applicationinstance thereby reducing the memory footprint of the application duringthe applications life.

Once the bytecode is generated, the bytecode may be used to startruntime services for several application instances on the cloud on thesame virtual machine or different virtual machines. In the illustratedexample, the bytecode is pre-generated prior to runtime. For example,the bytecode may be generated well before any application instances arestarted on the cloud. Then, at runtime (block 534), virtual machine 170Amay execute the bytecode (block 536). For example, to start anapplication instance, the virtual machine 170A may execute the bytecodedirectly. Upon executing the bytecode, the bytecode directly invokes thesame sequence or series of invocations on real objects (e.g., Object_Aand Object_B) (block 538). The bytecode advantageously allows for directcalls to classes used for runtime without loading classes used only fordeployment, thereby reducing the amount of classes called and loadedduring runtime. By calling and loading fewer classes, runtime memoryusage and startup time is advantageously reduced.

Other instances of the application may also be started. In theillustrated example, other virtual machines (e.g., virtual machine 170B)may also execute the same bytecode. For example, to start anotherinstance of the application, the virtual machine 170B may execute thepreviously generated bytecode directly. The resulting deployedapplication instances may be smaller than an application instancestarted using traditional approaches. By reducing runtime overhead ofapplications (e.g., Java applications), the memory footprint and memoryconsumption is advantageously reduced which provides performance andcost advantages, specifically in cloud environments.

FIG. 6 is a block diagram of an example bytecode generation system 600using proxy based action recorders according to an example embodiment ofthe present disclosure. The bytecode generation system 600 includes amemory 610 and a processor 620 in communication with the memory 610. Thesystem 600 may also include a recorder 630 configured to, obtain a proxy640A-B for each respective real object 642A-B. Each respective realobject 642A-B may be related to a respective service 644A-B. Therecorder 630 may also be configured to record a sequence 650 of eachinvocation 660A-B on each respective proxy 640A-B. The recorder 630 mayalso be configured to generate an intermediate representation 670 of anapplication 680. The intermediate representation 670 may be configuredto invoke the sequence 650 of each invocation 660A-B on each real object642A-B associated with each respective proxy 640A-B.

By generating the intermediate representation 670 (e.g., bytecode) fromthe sequence 650 of invocations 660A-B, a user (e.g., developer orprogrammer) can automatically and generate bytecode by invoking onproxies 640A-B (e.g., calling methods on proxies 640A-B) instead ofdirectly writing out bytecode using a bytecode generation library, whichmay require extensive knowledge of virtual machine internals or codingexpertise. Accordingly, the disclosed system is user friendly andresults in reduced runtime memory usage, increased startup efficiency,and reduces overall application deployment resource requirements.

It will be appreciated that all of the disclosed methods and proceduresdescribed herein can be implemented using one or more computer programsor components. These components may be provided as a series of computerinstructions on any conventional computer readable medium ormachine-readable medium, including volatile or non-volatile memory, suchas RAM, ROM, flash memory, magnetic or optical disks, optical memory, orother storage media. The instructions may be provided as software orfirmware, and/or may be implemented in whole or in part in hardwarecomponents such as ASICs, FPGAs, DSPs or any other similar devices. Theinstructions may be configured to be executed by one or more processors,which when executing the series of computer instructions, performs orfacilitates the performance of all or part of the disclosed methods andprocedures.

Aspects of the subject matter described herein may be useful alone or incombination with one or more other aspects described herein. In a 1stexemplary aspect of the present disclosure, a system includes a memory,a processor in communication with the memory, and a recorder. Therecorder is configured to obtain a proxy for each respective realobject. Each respective real object is related to a respective service.The recorder is also configured to record a sequence of each invocationon each respective proxy and generate an intermediate representation ofan application that is configured to invoke the sequence of eachinvocation on each real object associated with each respective proxy.

In a 2nd exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the1st aspect), the intermediate representation is bytecode.

In a 3rd exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the2nd aspect), the bytecode is Java Virtual Machine bytecode.

In a 4th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the1st aspect), the recorder is configured to generate the intermediaterepresentation when the recorder stops recording.

In a 5th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the1st aspect), an invocation includes a method parameter.

Aspects of the subject matter described herein may be useful alone or incombination with one or more other aspects described herein. In a 6thexemplary aspect of the present disclosure, a method includes creating arecorder and obtaining a proxy for each respective real object. Eachrespective real object is related to a respective service. The methodalso includes recording a sequence of each invocation on each respectiveproxy and generating an intermediate representation of an applicationfrom the sequence.

In a 7th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the6th aspect), the intermediate representation is generated prior toruntime.

In an 8th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the7th aspect), the intermediate representation is generated at build time.

In a 9th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the6th aspect), the intermediate representation is bytecode.

In a 10th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the9th aspect), the bytecode is Java Virtual Machine bytecode.

In an 11th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the6th aspect), the method further includes, prior to generating theintermediate representation, pausing the recorder.

Aspects of the subject matter described herein may be useful alone or incombination with one or more other aspects described herein. In a 12thexemplary aspect of the present disclosure, a system includes a memory,a processor in communication with the memory, a recorder, and aplurality of virtual machines. The recorder is configured to record asequence of invocations on a plurality of proxies. Each proxy of theplurality of proxies is associated with a respective real object. Therecorder is also configured to generate bytecode from the recordedsequence of invocations. The plurality of virtual machines areconfigured to execute the bytecode generated by the recorder to startruntime services of at least one application.

Aspects of the subject matter described herein may be useful alone or incombination with one or more other aspects described herein. In a 13thexemplary aspect of the present disclosure, a method includes creating arecorder object, obtaining a first proxy for a first object related to afirst service, and obtaining a second proxy for a second object relatedto a second service. The method also includes recording a sequence ofinvocations on at least one of the first proxy and the second proxy,generating bytecode that is configured to invoke the sequence ofinvocations on the first object and the second object, and discardingthe first proxy and the second proxy.

In a 14th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the13th aspect), the bytecode is generated prior to runtime.

In a 15th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the15th aspect), the bytecode is generated at build time.

In a 16th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the13th aspect), the bytecode is Java Virtual Machine bytecode.

In a 17th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the13th aspect), the method further includes, prior to generating thebytecode, pausing the recorder.

Aspects of the subject matter described herein may be useful alone or incombination with one or more other aspects described herein. In an 18thexemplary aspect of the present disclosure, a method includes creating arecorder object and recording a sequence of invocations on a pluralityof proxies. Each proxy of the plurality of proxies is associated with arespective real object. The method also includes generating bytecodefrom the recorded sequence of invocations and executing the bytecode tostart runtime services of an application by invoking the sequence ofinvocations on the real objects associated with the plurality ofproxies.

In a 19th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the18th aspect), the bytecode is generated prior to runtime.

In a 20th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the19th aspect), the bytecode is generated at build time.

In a 21st exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the18th aspect), the bytecode is Java Virtual Machine bytecode.

In a 22nd exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the18th aspect), the method further includes, prior to generating thebytecode, pausing the recorder object.

Aspects of the subject matter described herein may be useful alone or incombination with one or more other aspects described herein. In a 23rdexemplary aspect of the present disclosure, a system includes a meansfor creating a recorder, a means for obtaining a proxy for eachrespective real objected related to a service, and a means for recordinga sequence of each invocation on each respective proxy. The system alsoincludes a means for generating, prior to runtime, an intermediaterepresentation of an application that is configured to invoke thesequence of on each real object associated with each respective proxy.

Aspects of the subject matter described herein may be useful alone or incombination with one or more other aspects described herein. In a 24thexemplary aspect of the present disclosure, a system includes a meansfor creating a recorder object and a means for recording a sequence ofinvocations on a plurality of proxies. Each proxy of the plurality ofproxies is associated with a respective real object. The system alsoincludes a means for generating bytecode from the recorded sequence ofinvocations and a means for executing the bytecode to start runtimeservices of an application by invoking the sequence of invocations onthe real objects associated with the plurality of proxies.

In a 25th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the24th aspect), the system further includes, prior to generating thebytecode, a means for pausing the recorder object prior to generatingthe bytecode.

Aspects of the subject matter described herein may be useful alone or incombination with one or more other aspects described herein. In a 26thexemplary aspect of the present disclosure, a non-transitory machinereadable medium stores code, which when executed by a processor, isconfigured to create a recorder, obtain a proxy for each respective realobjected related to a service and record a sequence of each invocationon each respective proxy. Additionally, the non-transitorymachine-readable medium is configured to generate, prior to runtime, anintermediate representation of an application that is configured toinvoke the sequence of on each real object associated with eachrespective proxy.

In a 27th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the26th aspect), the intermediate representation is bytecode.

In a 28th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the27th aspect), the bytecode is Java Virtual Machine bytecode.

In a 29th exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the26th aspect), an invocation includes a method parameter.

Aspects of the subject matter described herein may be useful alone or incombination with one or more other aspects described herein. In a 30thexemplary aspect of the present disclosure, a non-transitorymachine-readable medium stores code, which when executed by a processor,is configured to create a recorder object and record a sequence ofinvocations on a plurality of proxies. Each proxy of the plurality ofproxies is associated with a respective real object. The non-transitorymachine-readable medium is also configured to generate bytecode from therecorded sequence of invocations and execute the bytecode to startruntime services of an application by invoking the sequence ofinvocations on the real objects associated with the plurality ofproxies.

In a 31st exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the18th aspect), the bytecode is generated by a first virtual machine, andthe bytecode is executed by a second virtual machine.

In a 32nd exemplary aspect of the present disclosure, which may be usedin combination with any one or more of the preceding aspects (e.g., the31st aspect), the first virtual machine and the second virtual machineare different virtual machines.

To the extent that any of these aspects are mutually exclusive, itshould be understood that such mutual exclusivity shall not limit in anyway the combination of such aspects with any other aspect whether or notsuch aspect is explicitly recited. Any of these aspects may be claimed,without limitation, as a system, method, apparatus, device, medium, etc.

It should be understood that various changes and modifications to theexample embodiments described herein will be apparent to those skilledin the art. Such changes and modifications can be made without departingfrom the spirit and scope of the present subject matter and withoutdiminishing its intended advantages. It is therefore intended that suchchanges and modifications be covered by the appended claims.

The invention is claimed as follows:
 1. A method comprising: creating arecorder object; obtaining a first proxy for a first object related to afirst service; obtaining a second proxy for a second object related to asecond service; recording a sequence of invocations on the first proxyfor the first object and the second proxy for the second object;generating bytecode that is configured to invoke the sequence ofinvocations on the first proxy for the first object and the second proxyfor the second object; prior to generating the bytecode, closing therecorder object; and discarding the first proxy for the first object andthe second proxy for the second object.
 2. The method of claim 1,wherein the bytecode is generated prior to runtime.
 3. The method ofclaim 1, wherein the bytecode is generated at build time.
 4. The methodof claim 1, wherein the bytecode is Java Virtual Machine bytecode. 5.The method of claim 1, wherein an invocation of the sequence ofinvocations on the first proxy for the first object and the second proxyfor the second object includes a method parameter.
 6. A systemcomprising: a memory; a processor in communication with the memory; arecorder, wherein the recorder is configured to: record a sequence ofinvocations on a plurality of proxies, wherein each proxy of theplurality of proxies is associated with a respective real object, andgenerate bytecode from the recorded sequence of invocations on theplurality of proxies, wherein the recorder is configured to generate thebytecode when the recorder is closed; and a plurality of virtualmachines configured to execute the bytecode generated by the recorder tostart runtime services of at least one application.
 7. The system ofclaim 6, wherein the bytecode is generated prior to runtime.
 8. Thesystem of claim 6, wherein the bytecode is generated at build time. 9.The system of claim 6, wherein the bytecode is Java Virtual Machinebytecode.
 10. The system of claim 6, wherein the recorder is configuredto generate the bytecode when the recorder stops recording.
 11. Thesystem of claim 6, wherein an invocation of the recorded sequence ofinvocations on the plurality of proxies includes a method parameter. 12.The system of claim 6, wherein the plurality of virtual machinesincludes a first virtual machine and a second virtual machine, andwherein the bytecode is generated by the first virtual machine.
 13. Thesystem of claim 12, wherein the bytecode is executed by the secondvirtual machine.
 14. A non-transitory machine-readable medium storingcode, which when executed by a processor, is configured to: create arecorder; obtain a proxy for each respective real object related to aservice; record a sequence of each invocation on each real objectassociated with each respective proxy; and generate, prior to runtime,an intermediate representation of an application that is configured toinvoke the sequence of each invocation on each real object associatedwith each respective proxy, wherein the recorder is paused prior togenerating the intermediate representation of the application.
 15. Thenon-transitory machine-readable medium of claim 14, wherein theintermediate representation of the application is bytecode.
 16. Thenon-transitory machine-readable medium of claim 15, wherein the bytecodeis Java Virtual Machine bytecode.
 17. The non-transitorymachine-readable medium of claim 14, wherein an invocation of thesequence of each invocation on each real object associated with eachrespective proxy includes a method parameter.